<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>内容详情</title>
	<meta name="keywords" content="欧凸欧,医学网站,医学咨讯网" />
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta content="telephone=no" name="format-detection" />
	<style>
		body {
			margin:0;
		    font-family: "Hiragino Sans GB","Microsoft YaHei","黑体",Helvetica,Arial,Tahoma,sans-serif;
		    font-size: 16px;
		    color: #666;
		}
		.content{
			padding: 15px;
		}
		h2{
			margin: 0;
			font-size: 18px;
			color: #000;
			margin-bottom: 13px;
		}
		.content_meta{
			margin-bottom: 7px;
		}
		.content_meta em{
			font-style: normal;
		}
		.original{
			font-size: 12px;
			color: #999;
			display: inline-block;
			border:1px solid #999;
			padding: 1px 7px;
			border-radius: 7px;
			text-align: center;
		}
		.content_date{
			font-size: 12px;
			color: #000;
		}
		.content_author{
			font-size: 15px;
			color: #0099ff;
		}
		.sections span{
			display: inline-block;
			padding: 1px 6px;
			font-size: 14px;
			border-radius: 3px;
			color: #fff;
		}
		.medicine{
			background-color: #84ccc9;
		}
		.pediatrics{
			background-color: #fbdcac;
		}
		.surgical{
			background-color: #acdff8;
		}
		.deofgy{
			background-color: #ffbdde;
		}
		.chinese{
			background-color: #f29c9f;
		}
		.nutrition{
			background-color: #debdff;
		}
		.circle{
			background-color: #6666cc;
		}
		.other{
			background-color: #dbeab6;
		}
	</style>
	<script type="text/javascript">
		function edite(){
			var a = '';
			if(typeof($('#main-tab')) == undefined){
				a = parent.$('#main-tab');
			}else{
				a = $('#main-tab');
			}
			a.tabs('add',{
	            title:'文章修改',
	            content:'<iframe scrolling="auto" frameborder="0"  src="<?php echo CController::createUrl('community/update'); ?>&article_id=<?php echo $rows['article_id']?>" style="width:100%;height:700px"></iframe>',
	            closable:true
			});
			//$('#main-tab').tabs('getSelected').panel('refresh','<?php echo CController::createUrl('community/update'); ?>&article_id=<?php echo $rows['article_id']?>&from=list');
			a.tabs('getSelected').css('width', 'auto');
		}

		// $('#main-tab').tabs('getSelected').panel('refresh','<?php echo CController::createUrl('community/find')?>&article_id=<?php echo $rows['article_id']?>&from=list');
		// $('#main-tab').tabs('getSelected').css('width', 'auto');
		
		function del(){
			if(! confirm('你确定要删除该文章吗？')){
				return false;
			}
			var url = "<?php echo CController::createUrl('community/del'); ?>&article_id=<?php echo $rows['article_id']?>";
			$.ajax({
	            type: 'get',
	            url: url,
	            success: function(data){
	                if(data != ''){
	                	$('.opp').remove();
	                    alert('删除成功');
	                    
	                    
	                }else{
	                	alert('删除失败');
	                    
	                }
	            },
	            dataType: 'html'
	        });
		}
	</script>
</head>
<body>
	<div class="content" >
		<h2><?php echo $rows['title']?></h2>
		<div class="content_meta">
			<em class="original">原创</em>
			<em class="content_date"><?php echo date('Y-m-d H:s:i',$rows['create_time']->sec)?></em>&nbsp;&nbsp;
			<?php if($rows['article_status'] !=3){?><em class="original opp"><a onclick="del();" href="#"><b>删除</b></a></em><?php }?>
			<?php if($type != ''){?>
			<em class="original opp"><a href="#" onclick="edite();"><b>修改</b></a></em>
			<?php }?>
			           
        </div>
		<div class="sections">
			<?php $topic = array('内科','外科','妇科','儿科','中医保健','营养美食','其他','病友圈','求关心','求帮助');
				  $class = array('medicine','pediatrics','surgical','deofgy','chinese','nutrition','circle','other');
				  $topic_name = $rows['topics'];
				 
				  
			?>
			<?php foreach ($topic_name as $id =>$top){
							$top = json_decode($top,true);
				?>
				<span class="<?php echo $class[$top['topicId']]?>"><?php echo $top['topicName']?></span>
			<?php }?>
			
		</div>

		<div class="content_detail">
			<p><?php echo $rows['content']?></p>
		</div>
	</div>
</body>
</html>